<?php

class GHeader extends GHeaderParent {

    function __construct($tilulo) {
        parent::__construct($tilulo);
    }

    /**
     * Exibir o cabeçalho da página completo
     *
     * @param boolean $isIframe default: false
     * @param string $currentMenu default: 'index'
     * @param string $breadcrumb default: ''
     */
    function show($isIframe = false, $currentMenu = 'home', $breadcrumb = '') {
        parent::show();
        $show = '';
        if (!$isIframe) {
            $show .= '<body>';
            $show .= '<div id="main">';
            $show .= '<div id="header">';
            $show .= '<div id="logo">';
            $show .= '</div>';
            $show .= '<div id="menubar">';
            $show .= $this->getMenu($currentMenu);
            $show .= '</div>';
            $show .= '</div>';
            $show .= '<div id="site_content">';
            $show .= '<div id="content">';
            $show .= $this->getBreacrumb($breadcrumb);
        } else {
            $show .= '<body style="background:none;min-width: 0;min-height: 0;">';
            $show .= '<div class="__corpoFrame" style="padding: 5px;">';
        }
        echo $show;
    }

    function getMenu($current) {
        $html = '<ul id="menu">';

        $home = ($current == 'home') ? 'current' : '';
        $sair = ($current == 'sair') ? 'current' : '';

        $html .= '<li class="' . $home . '"><a href="' . URL_SYS . 'index.php">Home</a></li>';
        $html .= '<li class="' . $sair . '"><a href="' . URL_SYS . 'sair.php">Sair</a></li>';
        $html .= '</ul>';
        return $html;
    }

    function getBreacrumb() {
        $html = '<div id="breadcrumb">';
        //TODO: Implementar os breadcrumbs de acordo com o sistema
        $html .= '</div>';
        return $html;
    }

}
?>

